﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ProjectDirector.ViewModels.EmployeeViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<table width="100%"><tr><td></td><td><span style="font-size: 14px; font-weight: bold;"> Current Employee List
    </span></td><td align="right"><%: Html.ActionLink("[Create New Employee]", "Register","Account") %></td></tr></table>
    <hr style="border-width: 1px;" />
<table width="100%">
    <tr>
        <th align="left">
            Title
        </th>
        <th align="left">
            Name
        </th>       
        <th align="left">
            Job Title
        </th>
        <th align="left">
            Start Date
        </th>
       
        <th align="left">
            Contract Type
        </th>
        <th align="left">
            Mobile Phone
        </th>
        <th align="left">
            Work Phone
        </th>
        <th align="left">
            Work Email
        </th>
        <th align="left">
            Private Email
        </th>    
        <th align="left">
            Date Created
        </th>      
        <th></th>
    </tr>

<% foreach (var item in Model.Employees) { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.Title.TitleName) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.FirstName) %> <%: Html.DisplayFor(modelItem => item.LastName) %>
        </td>       
        <td>
            <%: Html.DisplayFor(modelItem => item.JobTitle.JobTitleName) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.StartDate) %>
        </td>        
        <td>
            <%: Html.DisplayFor(modelItem => item.ContractType.ContractTypeName) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.MobilePhone) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.WorkPhone) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.WorkEmail) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.PrivateEmail) %>
        </td>        
        <td>
            <%: Html.DisplayFor(modelItem => item.DateCreated) %>
        </td>        
        <td>
            <%: Html.ActionLink("Edit", "Edit", new { id=item.UserId }) %> |
            <%: Html.ActionLink("Details", "Details", new { id=item.UserId }) %>            
        </td>
    </tr>
<% } %>

</table>
<div class="pager">
<%: Html.PageLinks(Model.PagingInfo, x=>Url.Action("List", new{page=x})) %>
</div>
</asp:Content>
